<template>
	<view>
		<view class="box">
			<view>申请</view>
			<view class="box_word" >{{form.realName}}</view>
		</view>
		<view class="box">
			<view>名称</view>
			<view class="box_word" >{{form.name}}</view>
		</view>
		<view class="box">
			<view>地址</view>
			<view class="box_word" >{{form.address}}</view>
		</view>
		<view class="box">
			<view>电话</view>
			<view class="box_word" >{{form.phone}}</view>
		</view>
		<view v-if="form.auditState==0" class="box">
			<view>备注</view>
			
		
		</view>
		<view class="bzitem">
			<textarea v-model="form.remark" :disabled='form.auditState==0?false:true'></textarea>
		</view>
		
		<view class="btnd" v-if="form.auditState==0"  @click="getbtn(1)">
			同意
		</view>
		
		<view class="btnx" v-if="form.auditState==0" @click="getbtn(2)">
			拒绝
		</view>
	</view>
</template>

<script>
			import {jxsInfogetInfo,jxsInfoauditState} from "../../../api/order.js"
	export default {
		data() {
			return {
				id:"",
				form:{},
				remark:""
			}
		},
		onLoad(e){
			console.log("e");
			console.log(e);
			this.id=e.id
		},
		onShow() {
			this.getData()
		},
		methods: {
			getbtn(state){
				jxsInfoauditState({id:this.id,auditState:state,remark:this.form.remark}).then(res=>{
				if(res.status!=200){
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 2000
					})} 
					uni.navigateBack()
				})
			},
			getbtn1(state){
				console.log("123");
			},
			getData(){
				jxsInfogetInfo({id:this.id}).then(res=>{
					if(res.status!=200){
						uni.showToast({
							title:res.msg,
							icon:"none",
							duration:2000
						})
						return
					}
					this.form=res.data
					console.log("详情");
					console.log(res);
				
				})
			},
			goppdq(){
				this.$yrouter.push({
					path:"/pages/HzPages/ckxjView/ckxjView"
				})
			},
		}
	}
</script>

<style scoped lang="less">
	.box{
		
		width: 690upx;
		height: 70upx;
		margin: 0 auto;
		display: flex;
		justify-content: space-between;
		text-align: center;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
		margin-top: 30upx;
	}
	.box_word{
		font-size: 17 upx;

		// color: #0000004D;
		

	}
	.bzitem{
		width: 690upx;
		height: 270upx;
		margin: 0 auto;
		background-color: #EFEFF4;
		color: #282828;
		padding: 20upx;
	}
	.btnd{
		width: 300upx;
		height: 70upx;
		margin: 50upx auto 20upx auto;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #07c160;
		border-radius: 20upx; 
		color: #FFFFFF;
	}
	.btnx{
		
		width: 300upx;
		height: 70upx;
		margin: 10upx auto;
		display: flex;
		justify-content: center;
		align-items: center;
		background-color: #ff0000;
		border-radius: 20upx; 
		color: #FFFFFF;
	}
</style>
